<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>04_事件修饰符</title>
        <!-- 引入Vue -->
        <script type="text/javascript" src="../js/vue.js"></script>
    </head>
    <body>
        <!-- 准备好一个容器-->
        <div id="demo">
            <form action="https://www.baidu.com">
				<button @click.prevent="showMsg1">点我提示信息1</button>
			</form>

            <!-- stop修饰符 -->
			<div @click="showMsg1" class="box">
				<button @click.stop="showMsg2">点我提示信息2</button>
			</div>

            <!-- 修饰符的串联 -->
			<form action="https://www.baidu.com" @click="showMsg3">
				<button @click.stop.prevent="showMsg4">点我提示信息4</button>
			</form>
        </div>
    </body>

    <script type="text/javascript">
        //阻止 vue 在启动时生成生产提示。
        Vue.config.productionTip = false;
        new Vue({
            el:'#demo',
            methods:{
                showMsg1(){
                    alert('你好呀1')
                },
                showMsg2(){
                    alert('你好呀2')
                },
                showMsg3(){
					alert('你好啊3！')
				},
				showMsg4(){
					alert('你好啊4！')
				}
            }
        })

        
    </script>
</html>